package api_model

import (
	"time"
)

func CreateSysPlatformBalanceLogFactory(sqlType string) *SysPlatformBalanceLog {
	return &SysPlatformBalanceLog{BaseModel: BaseModel{DB: UseDbConn(sqlType)}}
}

type SysPlatformBalanceLog struct {
	BaseModel
	Id         int32     `gorm:"column:id;primary_key;AUTO_INCREMENT;NOT NULL"`
	Money      float64   `gorm:"column:money;NOT NULL;comment:'金额'"`
	Type       int8      `gorm:"column:type;NOT NULL;comment:'0 收入 1 支出'"`
	Source     int8      `gorm:"column:source;NOT NULL;comment:'变更来源 1分佣奖励 2 投诉处理 3照妖镜收入 4礼品包收入 66发布任务预收扣除'"`
	Remark     string    `gorm:"column:remark;NOT NULL;comment:'备注'"`
	OrderSn    string    `gorm:"column:order_sn;NOT NULL;comment:'关联订单'"`
	CreateTime time.Time `gorm:"column:create_time;default:CURRENT_TIMESTAMP;NOT NULL;comment:'创建时间'"`
}

func (s *SysPlatformBalanceLog) TableName() string {
	return "sys_platform_balance_log"
}
